Integrand size = 40, antiderivative size = 124 \[ \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=b^2 (b B+3 a C) x+\frac {a \left (a^2 B+6 b^2 B+6 a b C\right ) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b^2 (a B-2 b C) \sin (c+d x)}{2 d}+\frac {a^2 (2 b B+a C) \tan (c+d x)}{d}+\frac {a B (a+b \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d} \]
[Out]
Time = 0.46 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {3108, 3068, 3110, 3102, 2814, 3855} \[ \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\frac {a \left (a^2 B+6 a b C+6 b^2 B\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 (a C+2 b B) \tan (c+d x)}{d}-\frac {b^2 (a B-2 b C) \sin (c+d x)}{2 d}+b^2 x (3 a C+b B)+\frac {a B \tan (c+d x) \sec (c+d x) (a+b \cos (c+d x))^2}{2 d} \]
[In]
[Out]
Rule 2814
Rule 3068
Rule 3102
Rule 3108
Rule 3110
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \int (a+b \cos (c+d x))^3 (B+C \cos (c+d x)) \sec ^3(c+d x) \, dx \\ & = \frac {a B (a+b \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \int (a+b \cos (c+d x)) \left (2 a (2 b B+a C)+\left (a^2 B+2 b^2 B+4 a b C\right ) \cos (c+d x)-b (a B-2 b C) \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx \\ & = \frac {a^2 (2 b B+a C) \tan (c+d x)}{d}+\frac {a B (a+b \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{2} \int \left (-a \left (a^2 B+6 b^2 B+6 a b C\right )-2 b^2 (b B+3 a C) \cos (c+d x)+b^2 (a B-2 b C) \cos ^2(c+d x)\right ) \sec (c+d x) \, dx \\ & = -\frac {b^2 (a B-2 b C) \sin (c+d x)}{2 d}+\frac {a^2 (2 b B+a C) \tan (c+d x)}{d}+\frac {a B (a+b \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {1}{2} \int \left (-a \left (a^2 B+6 b^2 B+6 a b C\right )-2 b^2 (b B+3 a C) \cos (c+d x)\right ) \sec (c+d x) \, dx \\ & = b^2 (b B+3 a C) x-\frac {b^2 (a B-2 b C) \sin (c+d x)}{2 d}+\frac {a^2 (2 b B+a C) \tan (c+d x)}{d}+\frac {a B (a+b \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {1}{2} \left (a \left (a^2 B+6 b^2 B+6 a b C\right )\right ) \int \sec (c+d x) \, dx \\ & = b^2 (b B+3 a C) x+\frac {a \left (a^2 B+6 b^2 B+6 a b C\right ) \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b^2 (a B-2 b C) \sin (c+d x)}{2 d}+\frac {a^2 (2 b B+a C) \tan (c+d x)}{d}+\frac {a B (a+b \cos (c+d x))^2 \sec (c+d x) \tan (c+d x)}{2 d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(277\) vs. \(2(124)=248\).
Time = 4.52 (sec) , antiderivative size = 277, normalized size of antiderivative = 2.23 \[ \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\frac {4 b^2 (b B+3 a C) (c+d x)-2 a \left (a^2 B+6 b^2 B+6 a b C\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+2 a \left (a^2 B+6 b^2 B+6 a b C\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {a^3 B}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 a^2 (3 b B+a C) \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}-\frac {a^3 B}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 a^2 (3 b B+a C) \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )}+4 b^3 C \sin (c+d x)}{4 d} \]
[In]
[Out]
Time = 1.34 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.07
method | result | size |
parts | \(\frac {\left (B \,b^{3}+3 C a \,b^{2}\right ) \left (d x +c \right )}{d}+\frac {\left (3 B a \,b^{2}+3 C \,a^{2} b \right ) \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {\left (3 B \,a^{2} b +C \,a^{3}\right ) \tan \left (d x +c \right )}{d}+\frac {B \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {\sin \left (d x +c \right ) C \,b^{3}}{d}\) | \(133\) |
derivativedivides | \(\frac {C \,a^{3} \tan \left (d x +c \right )+B \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 C \,a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \,a^{2} b \tan \left (d x +c \right )+3 C a \,b^{2} \left (d x +c \right )+3 B a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \sin \left (d x +c \right ) b^{3}+B \,b^{3} \left (d x +c \right )}{d}\) | \(141\) |
default | \(\frac {C \,a^{3} \tan \left (d x +c \right )+B \,a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 C \,a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+3 B \,a^{2} b \tan \left (d x +c \right )+3 C a \,b^{2} \left (d x +c \right )+3 B a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \sin \left (d x +c \right ) b^{3}+B \,b^{3} \left (d x +c \right )}{d}\) | \(141\) |
parallelrisch | \(\frac {-a \left (1+\cos \left (2 d x +2 c \right )\right ) \left (B \,a^{2}+6 B \,b^{2}+6 C a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+a \left (1+\cos \left (2 d x +2 c \right )\right ) \left (B \,a^{2}+6 B \,b^{2}+6 C a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+2 b^{2} d x \left (B b +3 a C \right ) \cos \left (2 d x +2 c \right )+\left (6 B \,a^{2} b +2 C \,a^{3}\right ) \sin \left (2 d x +2 c \right )+C \sin \left (3 d x +3 c \right ) b^{3}+\left (2 B \,a^{3}+C \,b^{3}\right ) \sin \left (d x +c \right )+2 b^{2} d x \left (B b +3 a C \right )}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(201\) |
risch | \(b^{3} B x +3 a \,b^{2} C x -\frac {i {\mathrm e}^{i \left (d x +c \right )} C \,b^{3}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} C \,b^{3}}{2 d}-\frac {i a^{2} \left (B a \,{\mathrm e}^{3 i \left (d x +c \right )}-6 B b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 a C \,{\mathrm e}^{2 i \left (d x +c \right )}-B a \,{\mathrm e}^{i \left (d x +c \right )}-6 B b -2 a C \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {B \,a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,b^{2}}{d}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C b}{d}+\frac {B \,a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,b^{2}}{d}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C b}{d}\) | \(272\) |
norman | \(\frac {\left (-B \,b^{3}-3 C a \,b^{2}\right ) x +\left (-6 B \,b^{3}-18 C a \,b^{2}\right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 B \,b^{3}-6 C a \,b^{2}\right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 B \,b^{3}-6 C a \,b^{2}\right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (B \,b^{3}+3 C a \,b^{2}\right ) x \left (\tan ^{16}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 B \,b^{3}+6 C a \,b^{2}\right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 B \,b^{3}+6 C a \,b^{2}\right ) x \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (6 B \,b^{3}+18 C a \,b^{2}\right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (B \,a^{3}-6 B \,a^{2} b -2 C \,a^{3}+2 C \,b^{3}\right ) \left (\tan ^{15}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (5 B \,a^{3}-18 B \,a^{2} b -6 C \,a^{3}+2 C \,b^{3}\right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (5 B \,a^{3}+30 B \,a^{2} b +10 C \,a^{3}-6 C \,b^{3}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (9 B \,a^{3}-6 B \,a^{2} b -2 C \,a^{3}-6 C \,b^{3}\right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (B \,a^{3}+6 B \,a^{2} b +2 C \,a^{3}+2 C \,b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (5 B \,a^{3}-30 B \,a^{2} b -10 C \,a^{3}-6 C \,b^{3}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (5 B \,a^{3}+18 B \,a^{2} b +6 C \,a^{3}+2 C \,b^{3}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (9 B \,a^{3}+6 B \,a^{2} b +2 C \,a^{3}-6 C \,b^{3}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{3}}-\frac {a \left (B \,a^{2}+6 B \,b^{2}+6 C a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a \left (B \,a^{2}+6 B \,b^{2}+6 C a b \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(636\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.35 \[ \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\frac {4 \, {\left (3 \, C a b^{2} + B b^{3}\right )} d x \cos \left (d x + c\right )^{2} + {\left (B a^{3} + 6 \, C a^{2} b + 6 \, B a b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B a^{3} + 6 \, C a^{2} b + 6 \, B a b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, C b^{3} \cos \left (d x + c\right )^{2} + B a^{3} + 2 \, {\left (C a^{3} + 3 \, B a^{2} b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]
[In]
[Out]
Timed out. \[ \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\text {Timed out} \]
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.36 \[ \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\frac {12 \, {\left (d x + c\right )} C a b^{2} + 4 \, {\left (d x + c\right )} B b^{3} - B a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, C a^{2} b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, B a b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, C b^{3} \sin \left (d x + c\right ) + 4 \, C a^{3} \tan \left (d x + c\right ) + 12 \, B a^{2} b \tan \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 239 vs. \(2 (118) = 236\).
Time = 0.36 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.93 \[ \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\frac {\frac {4 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 2 \, {\left (3 \, C a b^{2} + B b^{3}\right )} {\left (d x + c\right )} + {\left (B a^{3} + 6 \, C a^{2} b + 6 \, B a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (B a^{3} + 6 \, C a^{2} b + 6 \, B a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + B a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, B a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 3.00 (sec) , antiderivative size = 249, normalized size of antiderivative = 2.01 \[ \int (a+b \cos (c+d x))^3 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^4(c+d x) \, dx=\frac {\frac {C\,a^3\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {C\,b^3\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {B\,a^3\,\sin \left (c+d\,x\right )}{2}+\frac {C\,b^3\,\sin \left (c+d\,x\right )}{4}+\frac {3\,B\,a^2\,b\,\sin \left (2\,c+2\,d\,x\right )}{2}}{d\,\left (\frac {\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {1}{2}\right )}-\frac {2\,\left (\frac {B\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,1{}\mathrm {i}}{2}-B\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+B\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}-3\,C\,a\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+C\,a^2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,3{}\mathrm {i}\right )}{d} \]
[In]
[Out]